
#
# WARNING WARNING WARNING
#
# This file is generated by generate_mozbuild.py (from
# https://github.com/mozilla/angle). Do not modify it without also modifying
# generate_mozbuild.py.
#
# WARNING WARNING WARNING
#
UNIFIED_SOURCES += [
    'libEGL.cpp',
]


if CONFIG['GNU_CXX']:
    CXXFLAGS += [
        '-Wno-attributes',
        '-Wno-shadow',
        '-Wno-sign-compare',
        '-Wno-unknown-pragmas',
        '-Wno-unreachable-code',
    ]
    if CONFIG['CLANG_CXX']:
        CXXFLAGS += [
            '-Wno-inconsistent-missing-override',
            '-Wno-unused-private-field',
        ]
    else:
        CXXFLAGS += [
            '-Wno-shadow-compatible-local',
            '-Wno-shadow-local',
        ]

if CONFIG['MOZ_DIRECTX_SDK_PATH'] and not CONFIG['MOZ_HAS_WINSDK_WITH_D3D']:
    LOCAL_INCLUDES += ['%' + '%s/include/' % CONFIG['MOZ_DIRECTX_SDK_PATH']]

DEFINES['_CRT_SECURE_NO_DEPRECATE'] = True
DEFINES['_HAS_EXCEPTIONS'] = 0

if not CONFIG['MOZ_DEBUG']:
    DEFINES['_SECURE_SCL'] = 0

DEFINES['ANGLE_ENABLE_D3D9'] = True
DEFINES['ANGLE_SKIP_DXGI_1_2_CHECK'] = True
if CONFIG['MOZ_HAS_WINSDK_WITH_D3D']:
    DEFINES['ANGLE_ENABLE_D3D11'] = True

DEFINES['ANGLE_COMPILE_OPTIMIZATION_LEVEL'] = 'D3DCOMPILE_OPTIMIZATION_LEVEL1'
DEFINES['ANGLE_NO_EXCEPTIONS'] = True

# We need these defined to nothing so that we don't get bogus dllimport declspecs
DEFINES['GL_APICALL'] = ""
DEFINES['GL_GLEXT_PROTOTYPES'] = ""
DEFINES['EGLAPI'] = ""



LOCAL_INCLUDES += [ '../../include', '../../src', '../../src/third_party/khronos' ]
USE_LIBS += [ 'libGLESv2' ]

DEFINES['LIBANGLE_IMPLEMENTATION'] = "1"
DEFINES['ANGLE_ENABLE_HLSL'] = "1"
DEFINES['ANGLE_ENABLE_GLSL'] = "1"
DEFINES['ANGLE_ENABLE_ESSL'] = "1"
DEFINES['ANGLE_ENABLE_KEYEDMUTEX'] = "1"

if CONFIG['MOZ_HAS_WINSDK_WITH_D3D']:
  OS_LIBS += [ 'd3d9', 'dxguid' ]
else:
  EXTRA_DSO_LDOPTS += [
    '\'%s/lib/%s/d3d9.lib\'' % (CONFIG['MOZ_DIRECTX_SDK_PATH'], CONFIG['MOZ_D3D_CPU_SUFFIX']),
    '\'%s/lib/%s/dxguid.lib\'' % (CONFIG['MOZ_DIRECTX_SDK_PATH'], CONFIG['MOZ_D3D_CPU_SUFFIX']),
  ]


GeckoSharedLibrary('libEGL', linkage=None)

RCFILE = SRCDIR + '/libEGL.rc'
DEFFILE = SRCDIR + '/libEGL.def'

USE_LIBS += ['libANGLE']
